package com.sunny.ynhz.ui.daily;

import android.os.Bundle;
import android.view.View;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.widget.TextView;

import com.sunny.ynhz.R;
import com.sunny.ynhz.ui.base.AppBaseTranslationTitleBarActivity;
import com.sunny.ynhz.widget.MyWebview;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by luao on 2017/8/20.
 */

public class BannerDetailsActivity extends AppBaseTranslationTitleBarActivity {


    @BindView(R.id.tv_load)
    TextView tvLoad;
    @BindView(R.id.wb_view)
    MyWebview wbView;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fragment_sta);
        ButterKnife.bind(this);
        setTitle(getIntent().getStringExtra("title"));
        wbView.setWebChromeClient(new WebChromeClient());
        String url = getIntent().getStringExtra("url");
        wbView.loadUrl(url);

        wbView.setWebChromeClient(new WebChromeClient() {
            @Override
            public void onProgressChanged(WebView view, int newProgress) {
                // TODO 自动生成的方法存根

                if (newProgress == 100) {
                    tvLoad.setVisibility(View.GONE);//加载完网页进度条消失
                } else {
                    tvLoad.setVisibility(View.VISIBLE);//开始加载网页时显示进度条
                }

            }
        });
    }
}
